from bms import bmsservice as db
from flask import Blueprint, jsonify, redirect, url_for, request
import logging, requests
import sys, traceback, os, re

logger = logging.getLogger('bmsview')

bms = Blueprint("bms", __name__, url_prefix="/api/bms")


# 查询热门职位列表
@bms.route('/getPostPageList', methods=['GET'])
def bmsgetPostPageList():
    hot = request.args.get('hot')
    return jsonify(db.bmsgetPostPageList(hot))

# 查询职位列表
@bms.route('/getPostList', methods=['GET'])
def getPostList():
    pid = request.args.get('pid')
    return jsonify(db.getPostList(pid))

# 查询行业列表
@bms.route('/getIndustryList', methods=['GET'])
def getIndustryList():
    pid = request.args.get('pid')
    return jsonify(db.getIndustryList(pid))

# 查询学校列表
@bms.route('/getSchoolList', methods=['GET'])
def getSchoolList():
    param = {}
    param['limit'] = request.args.get('limit')
    param['keyword'] = request.args.get('keyword')
    return jsonify(db.getSchoolList(param))

# 查询福利列表
@bms.route('/getWelfareList', methods=['GET'])
def getWelfareList():
    pid = request.args.get('pid')
    return jsonify(db.getWelfareList(pid))
